#include "util/logging.h"
#include "ds/stringutils.h"

#include <stdio.h>
#include <stdarg.h>
#include <string.h>

static const char * ErrPrefix = "\tERROR: ";

void
SEx_ErrorSt ( const char * str )
{
	fprintf( stderr, "%s: %s\n", ErrPrefix, str );
}

void
SEx_ErrorfSt ( const char * fmt, ... )
{
	string * newfmt = SU_new( strlen(fmt) + strlen(ErrPrefix) + 1 );
	SU_set( newfmt, "%s%s\n", ErrPrefix, fmt );

	va_list args;
	va_start( args, fmt );
	vfprintf( stderr, newfmt->s, args );
	va_end(args);

	SU_free(newfmt);
}
